package com.scsj.supermarket.view.activity.messagemodel;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.scsj.supermarket.R;
import com.scsj.supermarket.adapter.MessageListAdapter;
import com.scsj.supermarket.bean.MessageListBean;
import com.scsj.supermarket.customview.MyDecoration;
import com.scsj.supermarket.view.activity.baseactivitymodel.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * 消息列表，物流消息，系统通知
 */
public class MessageListActivity extends BaseActivity {

    private RecyclerView mRecyclerview;
    private MessageListAdapter messageListAdapter;
    private List mData;

    @Override
    protected void createView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_message_list);
        //  ScreenAdapterTools.getInstance().loadView((ViewGroup)getWindow().getDecorView());
        //ScreenAdapterTools.getInstance().reset(this);//如果希望android7.0分屏也适配的话,加上这句
        initToolbar();
        initView();
        setToolbarTitle("物流消息");
        hasBack(true);

    }

    @Override
    protected void initView() {

        mRecyclerview = (RecyclerView) findViewById(R.id.recyclerview);
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void initData() {
        mData = new ArrayList();
        mData.add(new MessageListBean(R.mipmap.car, "商超专送", "今天8：08", "您已下单才能够等级考试解登录来访记录都是", "查看详情"));
        mData.add(new MessageListBean(R.mipmap.car, "商超专送", "今天8：08", "您已下单才能够等级考试解登录来访记录都是", "查看详情"));
        mData.add(new MessageListBean(R.mipmap.car, "商超专送", "今天8：08", "您已下单才能够等级考试解登录来访记录都是", "查看详情"));
        mData.add(new MessageListBean(R.mipmap.car, "商超专送", "今天8：08", "您已下单才能够等级考试解登录来访记录都是", "查看详情"));

        messageListAdapter = new MessageListAdapter(mData);
        mRecyclerview.setLayoutManager(new LinearLayoutManager(this));
        mRecyclerview.setAdapter(messageListAdapter);
        mRecyclerview.addItemDecoration(new MyDecoration(this, LinearLayoutManager.VERTICAL));

    }
}
